<?php

/**
 * Core CMS
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://core-media.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to info@core-media.com so we can send you a copy immediately.
 *
 * @category    Core CMS
 * @package     Core
 * @subpackage  Core_Command
 * @copyright   Copyright (c) 2007 - 2010,  Core Media USA (core-media.com)
 * @license     http://core-media.com/license/new-bsd     New BSD License
 * @version     $Id: Abstract.php 767 2010-05-04 19:22:01Z lowtower@gmx.de $
 */

abstract class Core_Command_Abstract extends Core_Abstract
{
    protected $_log = array();

    /**
     * if run is not overloaded by the class that
     * extends this it is seen as an error
     *
     */
    public function run($params = null)
    {
        $this->log($this->view->getTranslation('Invalid command'));
    }

    /**
     * add the message to the log stack
     *
     * @param string $message
     */
    public function log($message)
    {
        $this->_log[] = $message;
    }

    /**
     * returns the current log stack
     *
     * @return array
     */
    public function getResponse()
    {
        return $this->_log;
    }
}